home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12674 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.6 KB

  1. Path: news2.iij.ad.jp!usenet
  2. From: A@sh0.oi.iijnet.or.jp.po.iijnet.or.jp
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to clear screen?
  5. Date: Thu, 21 Mar 96 10:33:00 PDT
  6. Organization: Internet Initiative Japan Inc., Tokyo, JAPAN
  7. Message-ID: <NEWTNews.3294.827433346.h-shigeo@sh0.oi.iijnet.or.jp.po.iijnet.or.jp>
  8. References: <wmdjuBAE7oRxEwQ2@ryton.demon.co.uk>
  9. NNTP-Posting-Host: ppp0058.po.iijnet.or.jp
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; CHARSET=ISO-2022-JP
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. In article <wmdjuBAE7oRxEwQ2@ryton.demon.co.uk>, <adam@ryton.demon.co.uk> writes:
  16. > Path: 
  17. news2.iij.ad.jp!nf0.iij.ad.jp!news.iij.ad.jp!wnoc-tyo-news!matsu.nis.co.jp!aa.com!villon.nig.ac.jp!newssinet!sinetnews!news.join.ad.jp!newsxfer.itd.umich.edu!news.mathworks.com!u
  18. unet!in2.uu.net!tank.news.pipex.net!pipex!dispatch.news.demon.net!demon!ryton.demon.co.uk!adam
  19. > From: Adam Partridge <adam@ryton.demon.co.uk>
  20. > Newsgroups: comp.lang.c++
  21. > Subject: Re: How to clear screen?
  22. > Date: Wed, 13 Mar 1996 09:00:52 +0000
  23. > Organization: Chadwell Securities Ltd.
  24. > Lines: 59
  25. > Distribution: world
  26. > Message-ID: <wmdjuBAE7oRxEwQ2@ryton.demon.co.uk>
  27. > References: <c5a_9603070338@csource.blaze.net.au>
  28. > NNTP-Posting-Host: ryton.demon.co.uk
  29. > X-NNTP-Posting-Host: ryton.demon.co.uk
  30. > MIME-Version: 1.0
  31. > X-Newsreader: Turnpike Version 1.10 <30PmlnDvHYLo3bvohTFHqOcFfN>
  32. > If you are using MS-DOS as your platform try changing the video mode:
  33. > __asm{
  34. >         mov ax,0003
  35. >         int 10h
  36. >      }
  37. > Obviously you should change the video mode to what it was before the
  38. > clear.
  39. > If you're in a graphics mode you may want to try writing bytes to screen
  40. > memory (the example below is if you're using Watcom, for borland use
  41. > _mk_fp and I think it's _FP_SEG,_FP_OFF with Microsoft)
  42. > #define SCREEN_BYTES 200*320
  43. > #define CLEAR_COL 0
  44. > void fnMyCLS(void)
  45. > {
  46. >         void *pScreenMem=0xa0000;
  47. >         memset(pScreenMem,CLEAR_COL,SCREEN_BYTES);
  48. > }
  49. > !!!But be aware that some graphics modes use mapped graphics or paged
  50. > memory and you might find your self only clearing every fourth pixel,
  51. > only half of the screen or something equally as ridiculous.
  52. > You could also write a similar routine for clearing the screen in text
  53. > modes I think that the memory offset is then 0xb8000 (or is it 0xb0000?)
  54. > and then clearing one byte == clearing one letter.
  55. > If you're using windows have a look in the Windows API and choose
  56. > whichever function is most appropriate (the information that is
  57. > displayed before the clear may belong to a CDocument class, if you clear
  58. > the view, should you clear the information?)
  59. > I tend to be careful of graphics libraries, the graphics lib with MS
  60. > C7.00 was   S  L  O  W, and many of the functions were easy to rewrite
  61. > (although you do lose much of its general nature) especially as inline
  62. > assembler is so easy with the Microsoft Products (and IMHO MSVC 4.0 is a
  63. > dream).
  64. > If this seems very complicated then don't blame me, blame the computer,
  65. > it _is_ complicated under there (esp. SVGA). 
  66. > There are other alternatives pieces of code for clearing the screen, for
  67. > example using standard DOS text mode 3, you could just use:
  68. > for(unsigned char uchClearCount=0;uchClearCount<25;uchClearCount++)
  69. >         printf("\n");
  70. > But it ain't pretty.
  71. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  72. > Adam Partridge, Head of computing
  73. > Ryton Hall, Ryton, Shifnal, Shropshire, England
  74. > All of the opinions expressed in this E-mail are my own, my employers can 
  75. > jolly well find their own.
  76. >A 
  77.  
  78.  
  79.